<template>
  <div class="wrapper">
   <swiper :options="swiperOption" v-if="showLength">
    <!-- slides -->
    <swiper-slide class="swiper_img" v-for='item of list' :key="item.id"><img :src="item.imgUrl" /></swiper-slide>
    <!-- Optional controls -->
    <div class="swiper-pagination"  slot="pagination"></div>
   </swiper>
  </div>
</template>

<script>
export default {
  name: 'carrousel',
  props: {
    list: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      }
    }
  },
  computed: {
    showLength () {
      return this.list.length
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet-active
   background #fff !important
  .wrapper
   height 0
   width 100%
   padding-bottom 31.25%
   overflow hidden
   .swiper_img
     width 100%
     height 117px
     img
      height 100%
      width 100%
</style>
